package com.agentworkflow.engine.core.model;

import lombok.Data;

import java.util.Map;

@Data
public class VariableConfig {
    private String type;        // text, number, file, select
    private String label;       // 显示标签
    private Object defaultValue; // 默认值
    private boolean required = false;
    private Map<String, Object> options; // 额外选项

    public static VariableConfig text(String label, boolean required) {
        VariableConfig config = new VariableConfig();
        config.setType("text");
        config.setLabel(label);
        config.setRequired(required);
        return config;
    }

    public static VariableConfig file(String label, String... allowedTypes) {
        VariableConfig config = new VariableConfig();
        config.setType("file");
        config.setLabel(label);
        config.setOptions(Map.of("allowed_types", allowedTypes));
        return config;
    }

    public static VariableConfig select(String label, String... options) {
        VariableConfig config = new VariableConfig();
        config.setType("select");
        config.setLabel(label);
        config.setOptions(Map.of("options", options));
        return config;
    }
}
